package com.example.mybatisplus;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.mybatisplus.model.dto.UserDTO;
import com.example.mybatisplus.model.entity.User;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class MybatisPlusApplicationTest {

    @Test
    public void test() {
        new LambdaQueryWrapper<User>()
                .select(UserDTO::getId, UserDTO::getName);

        Wrappers.lambdaQuery()
                .select(UserDTO::getId, UserDTO::getName);
        lambdaQueryWrapper.eq(User::getName, "张三");

//        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
//        wrapper.select(User::getId, User::getName)
//                .join(Order.class, Order::getUserId, User::getId)
//                .eq(Order::getAmount, 100);
    }
}
